Skip to content

feat(auto-merge): create auto merge action MAPCO-9003#104

Merged
michalby24 merged 27 commits intomasterfrom
auto-merge
Jan 6, 2026
Merged

feat(auto-merge): create auto merge action MAPCO-9003#104
michalby24 merged 27 commits intomasterfrom
auto-merge

Conversation

@michalby24
Copy link
Contributor

@michalby24 michalby24 commented Dec 11, 2025

This pull request introduces a new GitHub Action for automatically merging pull requests that have the auto-merge label, and sets up workflow and release configuration for it. The action checks for the label, waits for required checks to pass, and merges the PR if conditions are met.
example: https://github.com/MapColonies/test-site/pull/60/ and here

Copy link
Contributor

@netanelC netanelC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always look for ready-to-use actions before you implement one. There is already an open-source action for that 👀

@michalby24
Copy link
Contributor Author

michalby24 commented Dec 14, 2025

Always look for ready-to-use actions before you implement one. There is already an open-source action for that 👀

I looked into switching to pascalgn/automerge-action as suggested.
The main issue is that it does not wait for all checks by itself.
image_720

Per its own documentation:

“When the pull request is ready, it will automatically be merged. The action will only wait for status checks that are marked as required in the branch protection rules.”
https://github.com/pascalgn/automerge-action#how-it-works
image

In our current setup, this isn’t enforceable because branch rulesets are not applied to private repositories on our plan:

image

As a result, the action can merge PRs before CI finishes, which we already observed.

My custom action explicitly waits for all PR checks to complete successfully inside the action itself, so it behaves correctly regardless of branch protection or plan limitations.

@netanelC
Copy link
Contributor

netanelC commented Dec 15, 2025

Always look for ready-to-use actions before you implement one. There is already an open-source action for that 👀

I looked into switching to pascalgn/automerge-action as suggested. The main issue is that it does not wait for all checks by itself. image_720

Per its own documentation:

“When the pull request is ready, it will automatically be merged. The action will only wait for status checks that are marked as required in the branch protection rules.” https://github.com/pascalgn/automerge-action#how-it-works image

In our current setup, this isn’t enforceable because branch rulesets are not applied to private repositories on our plan:

image As a result, the action can merge PRs before CI finishes, which we already observed.

My custom action explicitly waits for all PR checks to complete successfully inside the action itself, so it behaves correctly regardless of branch protection or plan limitations.

So you can separate to 2 steps: validating and merging. No need to implement the merge action (or the validatation stage in case this action does the job)

@alex131290
Copy link
Contributor

Always look for ready-to-use actions before you implement one. There is already an open-source action for that 👀

@michalby24 @netanelC this action is being maintained anymore, the last commit was over 1 year ago, i don't feel comfortable using such an old open source code

@michalby24 michalby24 changed the title feat(auto-merge): create auto merge action feat(auto-merge): create auto merge action MAPCO-9003 Dec 16, 2025
@michalby24 michalby24 changed the title feat(auto-merge): create auto merge action MAPCO-9003 feat(auto-merge): create auto merge action Dec 16, 2025
@netanelC
Copy link
Contributor

Always look for ready-to-use actions before you implement one. There is already an open-source action for that 👀

@michalby24 @netanelC this action is being maintained anymore, the last commit was over 1 year ago, i don't feel comfortable using such an old open source code

Too bad.. It seems like a good action

@ronenkapelian
Copy link
Contributor

should add auto-merge action also to .release-please-manifest.json

Copy link
Contributor

@ronenkapelian ronenkapelian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment about the release-please-manifest,

The test-auto-merge validating the "easy" flow when its not auto-merged, what about the intersting flow, when its true? any way to test it?

@michalby24 michalby24 closed this Dec 31, 2025
@michalby24 michalby24 reopened this Dec 31, 2025
@michalby24 michalby24 changed the title feat(auto-merge): create auto merge action feat(auto-merge): create auto merge action MAPCO-9003 Jan 4, 2026
@michalby24 michalby24 merged commit 5748433 into master Jan 6, 2026
2 checks passed
@michalby24 michalby24 deleted the auto-merge branch January 6, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants